package practise.inherit;

import java.util.Arrays;

public class StaticTest extends TestClassInit {

    public StaticTest(){
        System.out.println("StaticTest");
    }
    {System.out.println("Class StaticTest");}
	public static Parent p = new Parent();

    static {System.out.println("Static StaticTest");}
    public static void main(String[] args){
        new   StaticTest();
    }

}

class TestClassInit{
//    public TestClassInit(String a){  todo cannot use this constructor, the sub-class will call the super default constructor by default
//        System.out.println("TestClassInit");  todo if use this method, we must call this constructor from sub class
//    }

    public TestClassInit(){
        System.out.println("TestClassInit");
    }
    {System.out.println("Class TestClassInit");}
    static {System.out.println("Static TestClassInit");}
}

//Static TestClassInit
//Parent .
//        Static StaticTest
//Class TestClassInit
//TestClassInit
//        Class StaticTest
//        StaticTest
